<template>
	<view class="warehousePopup">
		<view class="warehouseList">
			<view class="item" v-for="(item,index) in list" :key="index" @click="checkItem(item)">
				<view class="icon"><u-icon
						name="https://supply.zhongyimotor.com/upload/applet/icon_address_supplier@2x.png"
						size="32"></u-icon></view>
				<view class="content">
					<view class="name">{{item.name}}</view>
					<view class="info">{{item.addressCountry}}{{item.addressCity}}{{item.addressDetails}}</view>
					<view class="tagList">
						<view class="tag">入库费：{{item.feeIn}}元</view>
						<view class="tag">出库费：{{item.feeOut}}元</view>
						<view class="tag">仓储费：{{item.charge}}元/天</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "warehouse",
		props: {
			list: {
				type: Array,
				default: () => []
			}
		},
		watch: {
			list(newLength, oldLength) {}
		},
		data() {
			return {

			};
		},
		onReady() {},
		methods: {
			checkItem(item) {
				console.log(1)
				this.$emit('onChange', item)
			}
		}
	}
</script>

<style lang="scss">
	.warehousePopup {
		height: 100vh;
		width: 100vw;
		background: #F7F7F7;

		.item {
			position: relative;

			&::after {
				position: absolute;
				height: 2rpx;
				background: #F2F2F2;
				bottom: 0;
				left: 80rpx;
				content: "";
				width: 100%;
			}

			&:last-child::after {
				display: none;
			}

			background: #FFF;
			padding: 30rpx;
			display: flex;

			.icon {
				margin-top: 5rpx;
			}

			.content {
				margin-left: 18rpx;


				.name {
					font-size: 32rpx;
					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					color: #202020;
					line-height: 44rpx;
					margin-bottom: 12rpx;
				}

				.info {
					font-size: 24rpx;
					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					color: #878787;
					line-height: 34rpx;
					margin-bottom: 12rpx;
				}

				.tagList {
					display: flex;

					.tag {
						padding: 0 12rpx;
						height: 40rpx;
						background: #F7F7F7;
						border-radius: 6rpx;
						font-size: 20rpx;
						font-family: PingFangSC, PingFang SC;
						font-weight: 400;
						color: #606060;
						line-height: 40rpx;
						text-align: center;
						margin-right: 10rpx;
					}
				}
			}
		}
	}
</style>